home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-09-27 | 35.5 KB | 1,229 lines |
- function gameIntF()
- {
- this.gameResetF();
- this.gameLevelV = this.gameLevelV + 1;
- var _loc4_ = Number(this.cubixMinV) + Number(this.gameLevelV);
- if(this.gameLevelV % 4 != 0)
- {
- var _loc5_ = Number(this.cubixRandomMinV) + Number(this.gameLevelV) % 4 - 1;
- }
- else
- {
- _loc5_ = Number(this.cubixRandomMinV) + Number(this.gameLevelV) % 4;
- }
- this.cubixColorStartV = this.gameLevelV % 8 - 1;
- if(this.cubixColorStartV < 0)
- {
- this.cubixColorStartV = 0;
- }
- trace("pieceV : " + _loc4_ + " -- randomV : " + _loc5_);
- this.cubixPieceV = _loc4_;
- this.cubixRowTotalV = _loc4_;
- this.cubixColTotalV = _loc4_;
- this.cubixTotalV = _loc4_ * _loc4_;
- this.cubixWV = this.stageWV / this.cubixPieceV;
- this.cubixHV = this.stageHV / this.cubixPieceV;
- this.cubixIntXGapV = 0;
- this.cubixIntYGapV = 0;
- this.cubixRandomV = _loc5_;
- this.itemChanceV = this.itemChanceMaxV;
- this.lineStepV = 0;
- this.lineStepTotalV = _loc4_;
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc3_] = new Array();
- this["tempDataArr" + _loc3_] = new Array();
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- this["dataArr" + _loc3_][_loc2_ - 1] = 0;
- this["tempDataArr" + _loc3_][_loc2_ - 1] = 0;
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc3_ = 1;
- while(_loc3_ <= this.cubixRandomV)
- {
- this["cubixTypeV" + _loc3_] = 0;
- _loc3_ = _loc3_ + 1;
- }
- this.gameEndTrig = false;
- this.makeCubixF();
- this.visualInterfaceIntF(true);
- this.visualPopupMF(true,"start");
- }
- function gameStartF()
- {
- this.gameBtnControlF(true);
- this.visualTimeMF(true);
- this.gameSoundObj.start();
- }
- function gameEndF(typeV)
- {
- if(!this.gameEndTrig)
- {
- this.gameSoundObj.stop();
- if(typeV != "fail")
- {
- if(typeV == "clear")
- {
- }
- }
- trace("gameOver : " + typeV);
- this.gameEndTrig = true;
- this.visualTimeMF(false);
- this.gameBtnControlF(false);
- this.ID_delay = setInterval(popupDelayF,1000,typeV);
- }
- }
- function popupDelayF(typeV)
- {
- clearInterval(ID_delay);
- visualPopupMF(true,typeV);
- }
- function gameResetF()
- {
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixTotalV)
- {
- this["cubixM" + _loc3_].removeMovieClip();
- _loc3_ = _loc3_ + 1;
- }
- _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc3_] = new Array();
- this["tempDataArr" + _loc3_] = new Array();
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- this["dataArr" + _loc3_][_loc2_ - 1] = 0;
- this["tempDataArr" + _loc3_][_loc2_ - 1] = 0;
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function gameBtnControlF(bool)
- {
- if(bool)
- {
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixTotalV)
- {
- this["cubixM" + _loc2_].enabled = true;
- this["cubixM" + _loc2_].onPress = function()
- {
- this._parent.removeCubixF(this.typeV,this.xPosSV,this.yPosSV);
- };
- _loc2_ = _loc2_ + 1;
- }
- if(this.itemChanceV > 0)
- {
- this.btn_random.enabled = true;
- this.btn_CCW.enabled = true;
- this.btn_CW.enabled = true;
- this.btn_random.onPress = function()
- {
- this.gotoAndStop("offL");
- this._parent.visualItemCheckF("random");
- };
- this.btn_random.onRollOver = function()
- {
- this.onEnterFrame = function()
- {
- this.nextFrame();
- if(this._currentframe == this._totalframes)
- {
- this.onEnterFrame = null;
- }
- };
- };
- this.btn_random.onRollOut = function()
- {
- this.onEnterFrame = function()
- {
- this.prevFrame();
- if(this._currentframe == 1)
- {
- this.onEnterFrame = null;
- }
- };
- };
- this.btn_CCW.onPress = function()
- {
- this.gotoAndStop("offL");
- this._parent.visualItemCheckF("rotation","CCW");
- };
- this.btn_CCW.onRollOver = function()
- {
- this.onEnterFrame = function()
- {
- this.nextFrame();
- if(this._currentframe == this._totalframes)
- {
- this.onEnterFrame = null;
- }
- };
- };
- this.btn_CCW.onRollOut = function()
- {
- this.onEnterFrame = function()
- {
- this.prevFrame();
- if(this._currentframe == 1)
- {
- this.onEnterFrame = null;
- }
- };
- };
- this.btn_CW.onPress = function()
- {
- this.gotoAndStop("offL");
- this._parent.visualItemCheckF("rotation","CW");
- };
- this.btn_CW.onRollOver = function()
- {
- this.onEnterFrame = function()
- {
- this.nextFrame();
- if(this._currentframe == this._totalframes)
- {
- this.onEnterFrame = null;
- }
- };
- };
- this.btn_CW.onRollOut = function()
- {
- this.onEnterFrame = function()
- {
- this.prevFrame();
- if(this._currentframe == 1)
- {
- this.onEnterFrame = null;
- }
- };
- };
- }
- }
- else
- {
- _loc2_ = 1;
- while(_loc2_ <= this.cubixTotalV)
- {
- this["cubixM" + _loc2_].enabled = false;
- _loc2_ = _loc2_ + 1;
- }
- this.btn_random.enabled = false;
- this.btn_CCW.enabled = false;
- this.btn_CW.enabled = false;
- this.btn_random.gotoAndStop("offL");
- this.btn_CCW.gotoAndStop("offL");
- this.btn_CW.gotoAndStop("offL");
- }
- }
- function makeCubixF()
- {
- var _loc6_ = 0;
- var _loc5_ = 1;
- while(_loc5_ <= this.cubixRowTotalV)
- {
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixColTotalV)
- {
- _loc6_ = _loc6_ + 1;
- var _loc2_ = this.attachMovie("cubixM","cubixM" + _loc6_,_loc6_);
- _loc2_._x = this.intXPosV + this.cubixWV / 2 + this.cubixWV * (_loc3_ - 1);
- _loc2_._y = this.intYPosV + this.cubixHV / 2 + this.cubixHV * (_loc5_ - 1);
- var _loc7_ = Number(random(this.cubixRandomV) + 1);
- var _loc4_ = new Object();
- _loc4_.nameV = _loc2_._name;
- _loc4_.typeV = _loc7_;
- _loc4_.checkTrig = false;
- this["dataArr" + _loc5_][_loc3_ - 1] = _loc4_;
- _loc2_.intF(_loc2_._name,_loc6_,_loc7_,this.cubixWV,this.cubixHV,_loc3_,_loc5_,this.cubixColorStartV);
- _loc3_ = _loc3_ + 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- }
- function setPositionCubixF(typeNumV)
- {
- this.gameBtnControlF(false);
- this.cubixExistCountV = 0;
- this.existCubixCheckF();
- if(this.cubixExistTotalV != 0)
- {
- this.calCubixSpeedF();
- var _loc3_ = this.cubixRowTotalV;
- while(_loc3_ >= 1)
- {
- var _loc2_ = this.cubixColTotalV;
- while(_loc2_ >= 1)
- {
- var _loc4_ = this[this["dataArr" + _loc3_][_loc2_ - 1].nameV];
- _loc4_.changeInfoArrayPositionF(_loc2_,_loc3_);
- var _loc5_ = this.intXPosV + this.cubixIntXGapV + this.cubixWV / 2 + this.cubixWV * (_loc2_ - 1);
- var _loc6_ = this.intYPosV + this.cubixIntYGapV + this.cubixHV / 2 + this.cubixHV * (_loc3_ - 1);
- _loc4_.changeInfoStagePositionF(_loc5_,_loc6_,typeNumV,this.cubixMoveSpeedV);
- _loc2_ = _loc2_ - 1;
- }
- _loc3_ = _loc3_ - 1;
- }
- }
- else
- {
- this.gameEndF("clear");
- }
- }
- function rotationCubixF(dirTypeV)
- {
- if(dirTypeV == "CCW")
- {
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["tempDataArr" + _loc3_] = new Array();
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- this["tempDataArr" + _loc3_][_loc2_ - 1] = this["dataArr" + _loc2_][this.cubixPieceV - _loc3_];
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- else if(dirTypeV == "CW")
- {
- _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["tempDataArr" + _loc3_] = new Array();
- _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- this["tempDataArr" + _loc3_][_loc2_ - 1] = this["dataArr" + Number(this.cubixPieceV - _loc2_ + 1)][_loc3_ - 1];
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc3_] = this["tempDataArr" + _loc3_];
- _loc3_ = _loc3_ + 1;
- }
- this.setPositionCubixF(1);
- }
- function checkCubixF(typeV, xPosV, yPosV)
- {
- var _loc6_ = typeV;
- var _loc5_ = 0;
- var _loc4_ = new Array();
- if(this["dataArr" + Number(yPosV - 1)][xPosV - 1].typeV == _loc6_)
- {
- _loc5_ = _loc5_ + 1;
- _loc4_.push(this["dataArr" + Number(yPosV - 1)][xPosV - 1].nameV);
- }
- if(this["dataArr" + Number(yPosV + 1)][xPosV - 1].typeV == _loc6_)
- {
- _loc5_ = _loc5_ + 1;
- _loc4_.push(this["dataArr" + Number(yPosV + 1)][xPosV - 1].nameV);
- }
- if(this["dataArr" + Number(yPosV)][xPosV - 2].typeV == _loc6_)
- {
- _loc5_ = _loc5_ + 1;
- _loc4_.push(this["dataArr" + Number(yPosV)][xPosV - 2].nameV);
- }
- if(this["dataArr" + Number(yPosV)][xPosV].typeV == _loc6_)
- {
- _loc5_ = _loc5_ + 1;
- _loc4_.push(this["dataArr" + Number(yPosV)][xPosV].nameV);
- }
- return _loc4_;
- }
- function removeCubixF(typeV, xPosV, yPosV)
- {
- if(!this.removeCheckTrig)
- {
- this.removeCheckTrig = true;
- var _loc14_ = this.checkCubixF(typeV,xPosV,yPosV);
- var _loc5_ = new Array();
- var _loc10_ = new Array();
- var _loc9_ = new Array();
- var _loc15_ = _loc14_.length;
- var _loc13_ = 0;
- var _loc12_ = false;
- if(_loc15_ >= 1)
- {
- _loc5_ = _loc5_.concat(_loc14_);
- while(!_loc12_)
- {
- var _loc11_ = _loc5_.length;
- var _loc7_ = 0;
- while(_loc7_ <= _loc11_ - 1)
- {
- var _loc4_ = this[_loc5_[_loc7_]];
- if(!_loc4_.checkTrig)
- {
- var _loc3_ = new Array();
- _loc3_ = this.checkCubixF(_loc4_.typeV,_loc4_.xPosSV,_loc4_.yPosSV).concat();
- if(_loc3_.length != 0)
- {
- _loc4_.checkTrig = true;
- var _loc8_ = _loc3_.length;
- var _loc2_ = 1;
- while(_loc2_ <= _loc8_)
- {
- var _loc6_ = Number(String(_loc3_[_loc2_ - 1]).slice(6));
- if(_loc9_[_loc6_ - 1] == undefined)
- {
- _loc9_[_loc6_ - 1] = _loc3_[_loc2_ - 1];
- _loc10_.push(_loc3_[_loc2_ - 1]);
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- }
- _loc7_ = _loc7_ + 1;
- }
- _loc5_ = new Array();
- _loc5_ = _loc10_.concat();
- if(_loc5_.length == _loc13_)
- {
- this.removeSoundObj.start();
- for(p in _loc5_)
- {
- this.matrixInfoDeleteF(_loc5_[p]);
- this[_loc5_[p]].removeMovieClip();
- }
- _loc12_ = true;
- this.removeCheckTrig = false;
- this.existCubixCheckF();
- this.matrixReformF();
- }
- else
- {
- _loc13_ = _loc5_.length;
- }
- }
- }
- else
- {
- this.removeCheckTrig = false;
- this.visualMisClickMF(xPosV,yPosV);
- this.visualScoreF(this.gameLevelV * 13 * -1);
- }
- }
- }
- function matrixInfoDeleteF(mcNameV)
- {
- var _loc2_ = this[mcNameV];
- var _loc3_ = _loc2_.xPosSV;
- var _loc4_ = _loc2_.yPosSV;
- this["dataArr" + _loc4_][_loc3_ - 1] = undefined;
- }
- function matrixReformF()
- {
- var _loc6_ = new Array();
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["tempDataArr" + _loc3_] = new Array();
- _loc3_ = _loc3_ + 1;
- }
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- var _loc4_ = this.cubixRowTotalV;
- _loc3_ = this.cubixRowTotalV;
- while(_loc3_ >= 1)
- {
- if(this["dataArr" + _loc3_][_loc2_ - 1] != undefined)
- {
- this["tempDataArr" + _loc4_].push(this["dataArr" + _loc3_][_loc2_ - 1]);
- _loc4_ = _loc4_ - 1;
- }
- _loc3_ = _loc3_ - 1;
- }
- if(_loc4_ == this.cubixRowTotalV)
- {
- _loc6_.push("blank");
- }
- else
- {
- _loc6_.push("noBlank");
- }
- if(_loc4_ > 0)
- {
- _loc3_ = _loc4_;
- while(_loc3_ >= 1)
- {
- this["tempDataArr" + _loc3_][_loc2_ - 1] = undefined;
- _loc3_ = _loc3_ - 1;
- }
- }
- _loc2_ = _loc2_ + 1;
- }
- var _loc5_ = 1;
- while(_loc5_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc5_] = this["tempDataArr" + _loc5_];
- _loc5_ = _loc5_ + 1;
- }
- _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- this["tempDataArr" + _loc3_] = new Array();
- _loc4_ = this.cubixRowTotalV;
- _loc2_ = this.cubixColTotalV;
- while(_loc2_ >= 1)
- {
- if(_loc6_[_loc2_ - 1] == "noBlank")
- {
- _loc4_ = _loc4_ - 1;
- this["tempDataArr" + _loc3_][_loc4_] = this["dataArr" + _loc3_][_loc2_ - 1];
- }
- _loc2_ = _loc2_ - 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc5_ = 1;
- while(_loc5_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc5_] = this["tempDataArr" + _loc5_];
- _loc5_ = _loc5_ + 1;
- }
- this.setPositionCubixF(2);
- }
- function randomCubixF()
- {
- var _loc7_ = new Array();
- var _loc9_ = new Array();
- var _loc14_ = false;
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- if(this["dataArr" + _loc3_][_loc2_ - 1] != undefined)
- {
- _loc7_.push(this["dataArr" + _loc3_][_loc2_ - 1]);
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- var _loc11_ = 0;
- var _loc8_ = _loc7_.length;
- var _loc5_ = 0;
- while(!_loc14_)
- {
- do
- {
- _loc5_ = random(_loc8_);
- }
- while(_loc9_[_loc5_] != undefined);
-
- _loc9_[_loc5_] = _loc7_[_loc11_].typeV;
- _loc11_ = _loc11_ + 1;
- if(_loc11_ == _loc8_)
- {
- _loc14_ = true;
- }
- }
- var _loc4_ = 1;
- while(_loc4_ <= _loc8_)
- {
- var _loc6_ = _loc7_[_loc4_ - 1].nameV;
- var _loc10_ = _loc9_[_loc4_ - 1];
- var _loc12_ = this[_loc6_].xPosSV;
- var _loc13_ = this[_loc6_].yPosSV;
- this["dataArr" + _loc13_][_loc12_ - 1].typeV = _loc10_;
- this[_loc6_].changeTypeF(_loc10_);
- _loc4_ = _loc4_ + 1;
- }
- }
- function matrixRebuild()
- {
- var _loc6_ = new Array();
- var _loc7_ = new Array();
- var _loc5_ = 1;
- while(_loc5_ <= this.cubixRowTotalV - 1)
- {
- this["tempDataArr" + _loc5_] = new Array();
- _loc5_ = _loc5_ + 1;
- }
- _loc5_ = this.cubixRowTotalV;
- while(_loc5_ >= 1)
- {
- var _loc2_ = this.cubixColTotalV;
- while(_loc2_ >= 1)
- {
- if(_loc2_ != 1 and _loc5_ != 1)
- {
- if(this["dataArr" + _loc5_][_loc2_ - 1] != undefined)
- {
- this["tempDataArr" + Number(_loc5_ - 1)][_loc2_ - 2] = this["dataArr" + _loc5_][_loc2_ - 1];
- }
- else
- {
- var _loc3_ = new Object();
- _loc3_.xPosV = _loc2_ - 2;
- _loc3_.yPosV = _loc5_ - 1;
- _loc6_.push(_loc3_);
- }
- }
- else if(this["dataArr" + _loc5_][_loc2_ - 1] != undefined)
- {
- _loc7_.push(this["dataArr" + _loc5_][_loc2_ - 1]);
- }
- _loc2_ = _loc2_ - 1;
- }
- _loc5_ = _loc5_ - 1;
- }
- if(_loc6_.length >= _loc7_.length)
- {
- var _loc4_ = 1;
- while(_loc4_ <= _loc7_.length)
- {
- var _loc8_ = _loc6_[_loc4_ - 1].xPosV;
- var _loc9_ = _loc6_[_loc4_ - 1].yPosV;
- this["tempDataArr" + _loc9_][_loc8_] = _loc7_[_loc4_ - 1];
- _loc4_ = _loc4_ + 1;
- }
- _loc5_ = this.cubixRowTotalV - 1;
- while(_loc5_ >= 1)
- {
- _loc2_ = this.cubixColTotalV - 1;
- while(_loc2_ >= 1)
- {
- if(this["tempDataArr" + _loc5_][_loc2_ - 1].typeV == undefined)
- {
- this["tempDataArr" + _loc5_][_loc2_ - 1] = undefined;
- }
- _loc2_ = _loc2_ - 1;
- }
- _loc5_ = _loc5_ - 1;
- }
- this["dataArr" + cubixRowTotalV] = new Array();
- this.cubixRowTotalV = this.cubixRowTotalV - 1;
- this.cubixColTotalV = this.cubixColTotalV - 1;
- this.cubixPieceV = this.cubixPieceV - 1;
- this.cubixIntXGapV += this.cubixWV / 2;
- this.cubixIntYGapV += this.cubixHV / 2;
- _loc5_ = 1;
- while(_loc5_ <= this.cubixRowTotalV)
- {
- this["dataArr" + _loc5_] = new Array();
- this["dataArr" + _loc5_] = this["tempDataArr" + _loc5_].concat();
- _loc5_ = _loc5_ + 1;
- }
- this.existCubixCheckF();
- this.setPositionCubixF(3);
- this.lineStepV = this.lineStepV + 1;
- this.visualResizeLineMF(true,this.cubixColTotalV * this.cubixWV + 4);
- }
- else
- {
- this.gameEndF("fail");
- }
- }
- function moveEndCheckF1()
- {
- this.cubixExistCountV = this.cubixExistCountV + 1;
- if(this.cubixExistCountV == this.cubixExistTotalV)
- {
- this.cubixExistCountV = 0;
- this.matrixReformF();
- }
- }
- function moveEndCheckF2()
- {
- this.cubixExistCountV = this.cubixExistCountV + 1;
- if(this.cubixExistCountV == this.cubixExistTotalV and !this.gameEndTrig)
- {
- this.gameEndCheckF();
- this.cubixExistCountV = 0;
- }
- }
- function existCubixCheckF()
- {
- this.cubixExistTotalV = 0;
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- if(this["dataArr" + _loc3_][_loc2_ - 1] != undefined)
- {
- this.cubixExistTotalV = this.cubixExistTotalV + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function gameEndCheckF()
- {
- var _loc6_ = 0;
- var _loc7_ = false;
- var _loc5_ = 1;
- while(_loc5_ <= this.cubixRandomV)
- {
- this["cubixTypeV" + _loc5_] = 0;
- _loc5_ = _loc5_ + 1;
- }
- var _loc4_ = 1;
- while(_loc4_ <= this.cubixRowTotalV)
- {
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- var _loc3_ = this["dataArr" + _loc4_][_loc2_ - 1].typeV;
- this["cubixTypeV" + _loc3_]++;
- _loc2_ = _loc2_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc5_ = 1;
- while(_loc5_ <= this.cubixRandomV)
- {
- if(this["cubixTypeV" + _loc5_] >= 2)
- {
- _loc7_ = true;
- break;
- }
- _loc5_ = _loc5_ + 1;
- }
- _loc4_ = 1;
- while(_loc4_ <= this.cubixRowTotalV)
- {
- _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- _loc3_ = this["dataArr" + _loc4_][_loc2_ - 1].typeV;
- this["cubixTypeV" + _loc3_]++;
- if(_loc3_ != undefined)
- {
- if(this.checkCubixF(_loc3_,_loc2_,_loc4_).length != 0)
- {
- break;
- }
- _loc6_ = _loc6_ + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- if(_loc6_ == this.cubixExistTotalV)
- {
- if(this.itemChanceV > 0)
- {
- if(!_loc7_)
- {
- this.gameEndF("clear");
- }
- else
- {
- this.gameBtnControlF(true);
- }
- }
- else if(this.itemChanceV <= 0)
- {
- this.gameEndF("clear");
- }
- }
- else
- {
- this.gameBtnControlF(true);
- }
- }
- function calPersentF()
- {
- this.existCubixCheckF();
- var _loc2_ = undefined;
- var _loc3_ = undefined;
- _loc2_ = Math.abs(this.cubixExistTotalV / this.cubixTotalV);
- _loc3_ = _loc2_ * 100 - Math.floor(_loc2_ * 100);
- if(_loc3_ != 0)
- {
- _loc3_ = 1;
- }
- _loc2_ = Math.round(100 - _loc2_ * 100) - _loc3_;
- return _loc2_;
- }
- function calCubixSpeedF()
- {
- var _loc4_ = 0;
- var _loc5_ = 0;
- var _loc3_ = 1;
- while(_loc3_ <= this.cubixRowTotalV)
- {
- var _loc2_ = 1;
- while(_loc2_ <= this.cubixColTotalV)
- {
- if(this["dataArr" + _loc3_][_loc2_ - 1] != undefined)
- {
- _loc4_ = _loc4_ + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc5_ = Math.round(_loc4_ / this.cubixMoveSpeedStepV);
- this.cubixMoveSpeedV = this.cubixMoveSpeedMinV + _loc5_ * 0.025;
- }
- function visualItemCheckF(typeV1, typeV2)
- {
- this.itemChanceV = this.itemChanceV - 1;
- if(this.itemChanceV >= 0)
- {
- if(typeV1 == "rotation")
- {
- this.itemSoundObj1.start();
- this.rotationCubixF(typeV2);
- }
- else if(typeV1 == "random")
- {
- this.itemSoundObj2.start();
- this.visualRandomF();
- }
- this.visualItemM.win.text = this.itemChanceV;
- this.visualItemM.gotoAndStop("s" + this.itemChanceV + "L");
- if(this.itemChanceV == 0)
- {
- this.btn_random.enabled = false;
- this.btn_CCW.enabled = false;
- this.btn_CW.enabled = false;
- }
- }
- else
- {
- this.itemChanceV = 0;
- this.btn_random.enabled = false;
- this.btn_CCW.enabled = false;
- this.btn_CW.enabled = false;
- }
- }
- function visualRandomF()
- {
- var _loc2_ = this.createEmptyMovieClip("randomM",this.randomDepthV);
- this.gameBtnControlF(false);
- _loc2_.countV = 0;
- _loc2_.onEnterFrame = function()
- {
- this._parent.randomCubixF();
- this.countV = this.countV + 1;
- if(this.countV >= 10)
- {
- this._parent.gameEndCheckF();
- this.removeMovieClip();
- this.onEnterFrame = null;
- }
- };
- }
- function visualTimeMF(bool)
- {
- var _loc2_ = this.visualTimeM;
- if(bool)
- {
- _loc2_.fpsV = this.fpsV;
- _loc2_.timeV = 0;
- _loc2_.timeSV = 0;
- _loc2_.timeMaxV = _loc2_.fpsV * this.gameLimitSecV;
- _loc2_.onEnterFrame = function()
- {
- if(!this._parent.popupTrig)
- {
- this.timeV = this.timeV + 1;
- this.timeSV = this.timeMaxV - this.timeV;
- if(this.timeSV <= 0)
- {
- this._parent.matrixRebuild();
- this.timeV = 0;
- }
- this._parent.visualTimeM.barM._xscale = this.timeSV / this.timeMaxV * 100;
- this._parent.visualTimeM.arrowM._x = this._parent.visualTimeM.barM._x + this._parent.visualTimeM.barM._width;
- }
- };
- }
- else
- {
- _loc2_.onEnterFrame = null;
- }
- }
- function visualPopupMF(bool, typeV)
- {
- if(bool)
- {
- this.openPopupTrig = true;
- var _loc2_ = this.attachMovie("visualPopupM","visualPopupM",this.popupDepthV);
- _loc2_._x = this.intXPosV + this.stageWV / 2;
- _loc2_._y = this.intYPosV + this.stageHV / 2;
- _loc2_.gotoAndStop(typeV + "L");
- }
- else
- {
- this.openPopupTrig = false;
- this.visualPopupM.gotoAndStop("offL");
- }
- }
- function visualMisClickMF(xPosV, yPosV)
- {
- var _loc3_ = this.getNextHighestDepth();
- var _loc2_ = this.attachMovie("baloomM","baloomM" + _loc3_,_loc3_);
- _loc2_._x = this.intXPosV + this.cubixIntXGapV + this.cubixWV / 2 + this.cubixWV * (xPosV - 1);
- _loc2_._y = this.intYPosV + this.cubixIntYGapV + this.cubixHV / 2 + this.cubixHV * (yPosV - 1);
- _loc2_.countV = 0;
- _loc2_.onEnterFrame = function()
- {
- if(!this._parent.gameEndTrig)
- {
- this.countV = this.countV + 1;
- if(this.countV >= 10)
- {
- this.removeMovieClip();
- this.onEnterFrame = null;
- }
- }
- else
- {
- this.removeMovieClip();
- this.onEnterFrame = null;
- }
- };
- }
- function visualResizeLineMF(bool, widthV)
- {
- if(bool)
- {
- this.lineM.targetWidthV = widthV;
- this.lineM.speedV = 0.25;
- this.lineM.onEnterFrame = function()
- {
- this._width += (this.targetWidthV - this._width) * this.speedV;
- this._height = this._width;
- if(Math.abs(this.targetWidthV - this._width) < 1)
- {
- this._width = this.targetWidthV;
- this._height = this.targetWidthV;
- this.onEnterFrame = null;
- }
- };
- }
- else
- {
- this.lineM._width = this.stageWV;
- this.lineM._height = this.stageHV;
- }
- }
- function visualInterfaceIntF(bool)
- {
- if(bool)
- {
- this.visualLevelM.win.text = this.gameLevelV;
- this.visualScoreM.win.text = this.gameScoreV;
- this.visualItemM.win.text = this.itemChanceMaxV;
- this.visualItemM.gotoAndStop("s3L");
- this.visualResizeLineMF(false);
- }
- else
- {
- this.visualLevelM.win.text = 0;
- this.visualScoreM.win.text = 0;
- this.visualItemM.win.text = this.itemChanceMaxV;
- this.visualItemM.gotoAndStop("s3L");
- this.visualResizeLineMF(false);
- }
- }
- function visualScoreF(numV)
- {
- this.gameScoreV += Number(numV);
- if(this.gameScoreV <= 0)
- {
- this.gameScoreV = 0;
- }
- this.visualScoreM.win.text = this.gameScoreV;
- }
- function visualTotalScoreF(typeV)
- {
- var _loc2_ = this.visualPopupM.visualEndM;
- _loc2_.levelV = this.gameLevelV;
- _loc2_.persentageV = 0;
- _loc2_.persentageSV = this.calPersentF();
- _loc2_.timeBonusV = 0;
- _loc2_.timeBonusSV = (this.lineStepTotalV - this.lineStepV) * 30;
- _loc2_.itemBonusV = 0;
- _loc2_.itemBonusSV = this.itemChanceV * 100;
- _loc2_.scoreV = 0;
- _loc2_.pageStepV = 1;
- _loc2_.soundCountV = 0;
- _loc2_.soundStepV = 4;
- if(typeV == "clear")
- {
- _loc2_.scoreSV = Number(_loc2_.persentageSV) * 10 + Number(_loc2_.timeBonusSV) + Number(_loc2_.itemBonusSV);
- _loc2_.onEnterFrame = function()
- {
- if(this.pageStepV == 1)
- {
- this.levelWin.text = this.levelV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else if(this.pageStepV == 2)
- {
- this.persentageV += 3;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.persentageV >= this.persentageSV)
- {
- this.persentageV = this.persentageSV;
- this.persentageWin.text = this.persentageV + " %";
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.persentageWin.text = this.persentageV + " %";
- }
- }
- else if(this.pageStepV == 3)
- {
- this.timeBonusV += 5;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.timeBonusV >= this.timeBonusSV)
- {
- this.timeBonusV = this.timeBonusSV;
- this.timeBonusWin.text = this.timeBonusSV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.timeBonusWin.text = this.timeBonusV;
- }
- }
- else if(this.pageStepV == 4)
- {
- this.itemBonusV += 30;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.itemBonusV >= this.itemBonusSV)
- {
- this.itemBonusV = this.itemBonusSV;
- this.itemBonusWin.text = this.itemBonusSV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.itemBonusWin.text = this.itemBonusV;
- }
- }
- else if(this.pageStepV == 5)
- {
- this.scoreV += 30;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.scoreV >= this.scoreSV)
- {
- this.scoreV = this.scoreSV;
- this.totalScoreWin.text = this.scoreSV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.totalScoreWin.text = this.scoreV;
- }
- }
- else if(this.pageStepV == 6)
- {
- this._parent._parent.visualScoreF(this.scoreSV);
- this.btn_next.onPress = function()
- {
- this._parent._parent._parent.gameIntF();
- this._parent._parent._parent.visualPopupMF(false);
- };
- this.onEnterFrame = null;
- }
- };
- }
- else if(typeV == "fail")
- {
- _loc2_.scoreSV = Number(_loc2_.persentageSV) * 10;
- _loc2_.onEnterFrame = function()
- {
- if(this.pageStepV == 1)
- {
- this.levelWin.text = this.levelV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else if(this.pageStepV == 2)
- {
- this.persentageV += 3;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.persentageV >= this.persentageSV)
- {
- this.persentageV = this.persentageSV;
- this.persentageWin.text = this.persentageV + " %";
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.persentageWin.text = this.persentageV + " %";
- }
- }
- else if(this.pageStepV == 3)
- {
- this.scoreV += 30;
- this.soundCountV = this.soundCountV + 1;
- if(this.soundCountV % this.soundStepV == 1)
- {
- this._parent._parent.scoreSoundObj.start();
- }
- if(this.scoreV >= this.scoreSV)
- {
- this.scoreV = this.scoreSV;
- this.levelScoreWin.text = this.scoreSV;
- this.pageStepV = this.pageStepV + 1;
- this.soundCountV = 0;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else
- {
- this.levelScoreWin.text = this.scoreV;
- }
- }
- else if(this.pageStepV == 4)
- {
- this._parent._parent.visualScoreF(this.scoreSV);
- this.totalScoreWin.text = this._parent._parent.gameScoreV;
- this.pageStepV = this.pageStepV + 1;
- this.gotoAndStop("s" + this.pageStepV + "L");
- }
- else if(this.pageStepV == 5)
- {
- this.btn_submit.onPress = function()
- {
- this._parent._parent._parent.gameLevelV = 0;
- this._parent._parent._parent.gameScoreV = 0;
- this._parent._parent._parent.gameResetF();
- this._parent._parent._parent.gotoAndStop("introL");
- this._parent._parent._parent.visualPopupMF(false);
- };
- this.btn_replay.onPress = function()
- {
- this._parent._parent._parent.gameLevelV = 0;
- this._parent._parent._parent.gameScoreV = 0;
- this._parent._parent._parent.visualInterfaceIntF(false);
- this._parent._parent._parent.gameIntF();
- this._parent._parent._parent.visualPopupMF(false);
- };
- this.onEnterFrame = null;
- }
- };
- }
- }
- stop();
- getURL("FSCommand:allowScale",false);
- Stage.showMenu = false;
- this.stageXPosMinV = 192;
- this.stageXPosMaxV = 476;
- this.stageYPosMinV = 49;
- this.stageYPosMaxV = 333;
- this.intXPosV = this.stageXPosMinV;
- this.intYPosV = this.stageYPosMinV;
- this.bottomXPosV = this.stageXPosMinV;
- this.bottomYPosV = this.stageYPosMaxV;
- this.stageWV = this.stageXPosMaxV - this.stageXPosMinV;
- this.stageHV = this.stageYPosMaxV - this.stageYPosMinV;
- this.cubixPieceV = 0;
- this.cubixRowTotalV = 0;
- this.cubixColTotalV = 0;
- this.cubixTotalV = 0;
- this.cubixMinV = 4;
- this.cubixRandomV = 0;
- this.cubixRandomMinV = 3;
- this.cubixColorStartV = 0;
- this.cubixWV = 0;
- this.cubixHV = 0;
- this.cubixIntXGapV = 0;
- this.cubixIntYGapV = 0;
- this.cubixExistTotalV = 0;
- this.cubixExistCountV = 0;
- this.cubixMoveSpeedMinV = 0.2;
- this.cubixMoveSpeedV = 0;
- this.cubixMoveSpeedStepV = 25;
- this.fpsV = 40;
- this.gameLevelV = 0;
- this.gameScoreV = 0;
- this.gameLimitSecV = 10;
- this.lineStepV = 0;
- this.lineStepTotalV = 0;
- this.gameEndTrig = false;
- this.itemChanceV = 0;
- this.itemChanceMaxV = 3;
- this.removeCheckTrig = false;
- this.openPopupTrig = false;
- this.popupDepthV = 1000;
- this.randomDepthV = 1001;
- this.mainSoundObj = new Sound(this);
- this.mainSoundObj.setVolume(50);
- this.introSoundObj = new Sound();
- this.introSoundObj.attachSound("introSound");
- this.gameSoundObj = new Sound();
- this.gameSoundObj.attachSound("gameSound");
- this.gameSoundObj.onSoundComplete = function()
- {
- this.start();
- };
- this.btnSoundObj = new Sound();
- this.btnSoundObj.attachSound("btnSound");
- this.clearSoundObj = new Sound();
- this.clearSoundObj.attachSound("clearSound");
- this.failSoundObj = new Sound();
- this.failSoundObj.attachSound("failSound");
- this.scoreSoundObj = new Sound();
- this.scoreSoundObj.attachSound("scoreSound");
- this.levelSoundObj = new Sound();
- this.levelSoundObj.attachSound("levelSound");
- this.itemSoundObj1 = new Sound();
- this.itemSoundObj1.attachSound("itemSound1");
- this.itemSoundObj2 = new Sound();
- this.itemSoundObj2.attachSound("itemSound2");
- this.removeSoundObj = new Sound();
- this.removeSoundObj.attachSound("removeSound");
-